<?php
Class Menu extends CI_Model
{
// 	var $table_name = 'admin';
// 	var $primary_key = 'id_username';

	function get_base_menu(){
		$sql = 'select * from menu where menu_id_menu is NULL';
		$query = $this->db->query($sql);
		return $query->result_array();
	}

	function get_menu($parent_menu = null){
		$this->db->select('*');
		$this->db->from('menu');

		if(isset($parent_menu))
			$this->db->where('menu_id_menu', $parent_menu);

		$query = $this->db->get();
		return $query->result_array();
	}
}
?>